import {Component, ViewChild} from '@angular/core';
import {Events, IonicPage, Navbar, NavController, NavParams} from 'ionic-angular';
import {Util} from "@providers/util";

/**
 * Generated class for the SuccessPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-success',
  templateUrl: 'success.html',
})
export class SuccessPage {
  @ViewChild(Navbar) navbar: Navbar;
  param: any = this.navParams.data;//上个传参

  constructor(public navCtrl: NavController,
              public navParams: NavParams,
              private events: Events) {
    if (!this.param.GZLX01) {
      this.param.GZLX01 = {
        VALUE: ''
      };
    }
    this.param.FWYYSJ = new Date(this.param.FWYYSJ);
    console.log(this.param);
    console.log(this.param.alldz[0]['VALUE']);
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad SuccessPage');

    Util.replaceBackButtonEvent(this.navbar, this.navCtrl, this.events);
  }

  goBack() {
    this.navCtrl.popTo(this.navCtrl.getByIndex(0));
  }

}
